package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;

	public class SpykeURLDisplayRemoter implements RemedyRemoter
	{
		private var mo:SpykeURLDisplay;

		public function SpykeURLDisplayRemoter(mo:SpykeURLDisplay)
		{
			this.mo = mo;
		}

		public function call(methodID:int, connection:RemedyClientServerConnection, onReturn:Function):void
		{
			switch (methodID)
			{
				case 59:
					mo.getName(function(ret:String):void {
						onReturn(ret, RemedyStringClassManager.INSTANCE);
					});
					break;
				case 58:
					mo.getID(function(ret:String):void {
						onReturn(ret, RemedyStringClassManager.INSTANCE);
					});
					break;
			}
		}

		public function run(methodID:int, connection:RemedyClientServerConnection):void
		{
			switch (methodID)
			{
				case 60:
					var a_60:SpykeURLDisplayListener = (SpykeURLDisplayListener)(RemedyMOClassManager.INSTANCE.readWithGraph(connection, new Vector.<Object>()));
					mo.registerListener(a_60);
					break;
				case 61:
					var a_61:String = (String)(RemedyStringClassManager.INSTANCE.readWithGraph(connection, new Vector.<Object>()));
					mo.renameRoom(a_61);
					break;
				case 67:
					mo.unPublish();
					break;
				case 66:
					mo.publish();
					break;
			}
		}
	}
}
